import config from 'config'
import httpFetch from 'share/httpFetch'

export default {

  //查询日历列表接口
  getCalendarList() {
    return httpFetch.get(`${config.baseUrl}/api/work/calendar/all`)
  },

  //根据年份和编码查询日历详情接口
  getCalendarDetail(params) {
    return httpFetch.get(`${config.baseUrl}/api/work/calendar`, params)
  },

  //根据日历编码复制日历接口
  copyCalendarWithCalendarCode(code, params) {
    return httpFetch.post(`${config.baseUrl}/api/work/calendar/copy?calendarCodeFrom=` + code, params)
  },

  //更新工作日历信息
  updateCalendarInfo(params) {
    return httpFetch.put(`${config.baseUrl}/api/work/calendar/update`, params)
  },

  //按年份更新日历详情
  updateCalendarDetailWithCalendarID(year, params) {
    return httpFetch.put(`${config.baseUrl}/api/work/calendar/detail/update?year=` + year, params)
  },

  //删除工作日历
  deleteCalendarByID(calendarId) {
    return httpFetch.delete(`${config.baseUrl}/api/work/calendar/` + calendarId)
  }
}
